Lonely: level editor for Layla (NES)

This is a level editor for the Japan-only NES/Famicom game Layla. It's capable of altering reasonably comprehensive range of data, including:
* Level patterns
* Pattern layouts
* Object layouts
* Metatile definitions
* Palettes
* Object stats (HP and weapon vulnerabilities)

This is a very niche application, and I mostly designed it for my own use. As a result, instead of outputting binary data for individual levels, it outputs entire ROMs at once. It also automatically expands the ROM to 256 kb and alters some code in order to circumvent the original game's limitations on level structure. In the unmodified game, levels are stored two to a bank, with patterns shared between them; Lonely's exported ROMs have one level per bank.

Build instructions: Make sure you have gcc, Qt, and libpng. Run "make" in the liblonely folder or use the included Visual Studio project (you should get a bazillion warnings), then build lonely-qt/lonely-qt.pro using Qt Creator. To use the program, you will need a Layla ROM.

Note that because I'm terrible at Windows, you'll need to do the following when building on it:
1. After building liblonely, copy liblonely/lib/libpng16.lib to your Qt build directory (the base folder, not "debug" or "release"). Rename it "png.lib" before proceeding.
2. After building lonely-qt, copy liblonely/lib/libpng16.dll and liblonely/lib/zlib1.dll to the same folder as your exectuable or it will crash on startup.
If you're trying to build a 64-bit executable, you may need to obtain 64-bit versions of the DLLs or something. I haven't even tried, so I can't help you there.

I'm omitting complete documentation of the program because I seriously doubt anyone else will ever need it and I'm inclined to spend my time more fruitfully (ha ha), but here's a quick overview of the most important stuff:

***Layout Editor***

There are three tools:
* Single-pattern insert/remove (shortcuts: Z key, clicking a pattern in the menu, right-clicking a pattern in the level display). In Insert mode (A key), this inserts new patterns into the level; in Overwrite mode (S key), it overwrites existing ones.
* Multi-pattern copy (shortcuts: X key, Ctrl + click-and-drag on the level display). Functions similarly to the above, but for multiple patterns. If "Copy nodes" is enabled, the program will attempt to copy any control nodes in the selection, though this can be a bit buggy.
* Multi-pattern move (shortcut: C, Shift + click-and-drag on the level display). After selecting a series of patterns in the level, double-click on the position to move them to.

The Q, W, and E keys switch among Visual, Behavior, and Solidity displays.

To edit control nodes, click a node in the node display and use the buttons to alter the data.

Clicking an entry in the Spawn List moves the camera to that spawn. The Add button under the Spawn List adds a new "spawn package" consisting of the necessary nodes to create a basic spawn position.

***Pattern Editor***

There are two tools:
* Pencil (shortcuts: right-click on a tile in the pattern display (dropper mode)). Draws single tiles into the pattern.
* Clone (shortcuts: Ctrl + click-and-drag on the pattern display). Copies a selected area of the pattern.

BG mode is a special mode used for creating backgrounds. When active, only areas set to metatile 0 will be altered by modifying operations. This means you can draw patterns with no background (only metatile 0) and fill them in later by copying from a single common background.

***Palettes***

Note that some palettes, e.g. the "Standard palette", are shared among all levels.
